package com.eblacorp.archive.view.bean.user;

import java.util.List;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;

import com.eblacorp.archive.security.ldap.model.Contact;
import com.eblacorp.archive.security.ldap.service.ContactService;

@ManagedBean
@ViewScoped
public class ManageUsersBean {
	@ManagedProperty(value = "#{contactService}")
	private ContactService contactService;
	private List<Contact> contacts;

	@PostConstruct
	public void init() {
		getAllContacts();
	}

	public void getAllContacts() {
		Contact c = contactService.findContactBySAMName("akhalaf");
		boolean b = c.isAdmin();
		boolean b2 = c.isDataEntry();
		contacts = contactService.listContacts();
	}

	public ContactService getContactService() {
		return contactService;
	}

	public void setContactService(ContactService contactService) {
		this.contactService = contactService;
	}

	public List<Contact> getContacts() {
		return contacts;
	}

	public void setContacts(List<Contact> contacts) {
		this.contacts = contacts;
	}

}
